<template>
  <el-dialog
    customClass="dialogRolCompClass"
    title="分配权限" width="350px"
    :visible.sync="showDialog"
    @close="close"
    ref="tree"
    append-to-body="true">
    <el-container>
      <el-main>
        <el-tree
          :data="menuTree"
          default-expand-all
          node-key="id"
          ref="tree"
          highlight-current
          :props="defaultProps">
        </el-tree>
      </el-main>
    </el-container>
  </el-dialog>
</template>
<script>
import sysAccreditApi from "./api/sysAccredit.service";

export default {
  data () {
    return {
      showDialog: false,
      menuTree: [],
      defaultProps: {
        children: "children",
        label: "name"
      }
    }
  },
  methods: {
    async show(row) {
      // getRolePermis
      this.checkTree = [];
      this.showDialog = true;
      let res = await sysAccreditApi.getRolePermis(row.id);
      this.menuTree = res.data;
    },
    close () {
      this.showDialog = false
    }
  }
}
</script>
<style>
.dialogRolCompClass .el-dialog__body {
  height: 460px!important;
  overflow-y: auto;
  padding:0;
}
</style>
